#include "BaseDal.h"
#include <stdio.h>

int BaseDal_SetAutoCommit(MYSQL * conn, int isauto)
{
	
	int val = isauto ? 1 : 0;	
	char sql[32] = {0};
	sprintf(sql, "set autocommit=%d", val);
	printf("10:before111111 query \n");
	if (mysql_query(conn, sql) != 0)
	{
		printf("12:in query \n");
		return 0;
	}
	else
	{
		printf("17:1111111111111in query what's this\n");

		return -1;
	}
}

int BaseDal_SaveChanges(MYSQL * conn)
{
	char * sql = "commit";
	if (mysql_query(conn, sql) != 0)
	{
		return 0;
	}
	else
	{
		return -1;
	}
}